#ifndef POINTITEM_H
#define POINTITEM_H

#include <QGraphicsItem>

#include <QtGui/QColor>
#include <QGraphicsItem>
#include "geometrydata.h"
#include "datastructures.h"
#include <QVector>
#include <QStyleOptionGraphicsItem>
#include <QPen>
#include <QPainter>
class PointItem : public QGraphicsItem
{
public:
    PointItem(Point *point);

    QRectF boundingRect() const;
    QPainterPath shape() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget);
    void select() {select_ = !select_;}

    void updateParams();
    Point * pnt() { return point; }

protected:
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

private:

    bool select_;

    QPen pen;
    QBrush brush_empty;
    QBrush brush_colored;

    Point *point;
    QRectF rect;
};

#endif // POINTITEM_H
